<?php 

	if ( function_exists('register_sidebars') ) register_sidebars(1);

	add_option( 'sh_breaking-news-main', '2' );
	add_option( 'sh_breaking-news-subs', '3' );

	add_action( 'admin_menu', 'breaking_news_add_theme_page' );

	function breaking_news_add_theme_page() {

		add_theme_page(__('Breaking News Options'), __('Breaking News Options'), 'edit_themes', basename(__FILE__), 'breaking_news_theme_page');
	}

	function breaking_news_theme_page() {

		if ( isset( $_POST['info_update'] ) ) {
			update_option( 'sh_breaking-news-main', $_POST['sh_new_breaking-news-main'] );
			update_option( 'sh_breaking-news-subs', $_POST['sh_new_breaking-news-subs'] );
			echo "	<div class=\"updated\">
					<p><strong>Options updated!</strong></p>
					</div>\n";
		}
	
		echo "	<div class=\"wrap\">
				<h2>Breaking News Theme Options</h2>

				<form action=\"\" method=\"post\">
					<p class=\"submit\">
						<input type=\"submit\" name=\"info_update\" value=\"Update Options &raquo;\" />
					</p>
					<fieldset>
						<h3>Home page Articles</h3>

						<p>Articles in the first main column: <input type=\"text\" name=\"sh_new_breaking-news-main\" value=\"" . get_option( "sh_breaking-news-main" ) . "\" /></p>

						<p>Articles in the side column: <input type=\"text\" name=\"sh_new_breaking-news-subs\" value=\"" . get_option( "sh_breaking-news-subs" ) . "\" /></p>

					</fieldset>
					<p class=\"submit\">
						<input type=\"submit\" name=\"info_update\" value=\"Update Options &raquo;\" />
					</p>
				</form>
				
			</div>\n";
	}


?>
